/**
 * Created by Administrator on 2017/1/21.
 */

var MJ = require('../MJ/MJ');
//拉庄状态
exports.LaZhuangStatus = {
    'NONE': 0,
    'FINISHED': 1,
};
var ScoreRule = clone(MJ.ScoreRule);
ScoreRule.DEALER = 201;      // 庄家
ScoreRule.XIAN = 202;      // 咸家
ScoreRule.KE = 203;      // 刻分
ScoreRule.GANG = 204;      // 杠分
ScoreRule.HUA = 205;      // 花分
ScoreRule.JIN = 206;      // 金分

ScoreRule.YOU = 208;      // 是否可以游金
ScoreRule.CHIYOU = 209;      // 吃游
ScoreRule.PENGYOU = 210;      // 碰游
ScoreRule.SANYOU = 207;      // 是否可三金倒

var Pattern = {
    'NONE': 0,                       // 不是可胡的牌型 0
    'NORMAL': MJ.Pattern.NORMAL,    // 平胡           1
    'ZM': 7,                        // 自摸           7
    'YOUJIN': 8,                     // 游金          8
    'SANJIN': 5,                     //3个宝直接胡牌    5
    'EIGHTHUA': 6,                     //8个花直接胡牌    6
};
var Result = {
    DRAW: 0,        // 平局
    DH: 1,          // 点胡
    ZM: 2,           // 自摸
    YJ: 3           //游金
}
var PatternScore = {};
PatternScore[Pattern.NORMAL] = 1;
PatternScore[Pattern.ZM] = 2;
PatternScore[Pattern.YOUJIN] = 3;
PatternScore[Pattern.SANJIN] = 3;
PatternScore[Pattern.EIGHTHUA] = 2;

var ItemScore = {};
ItemScore[ScoreRule.DEALER] = 8;
ItemScore[ScoreRule.XIAN] = 4;
ItemScore[ScoreRule.GANG] = 1;
ItemScore[ScoreRule.HUA] = 1;
ItemScore[ScoreRule.JIN] = 1;

ItemScore[Pattern.NORMAL] = 2;
ItemScore[Pattern.ZM] = 4;
ItemScore[Pattern.YOUJIN] = 6;
ItemScore[Pattern.SANJIN] = 6;
//ItemScore[Pattern.EIGHTHUA] = 6;

ItemScore[Pattern.YOU] = 0;
ItemScore[Pattern.SANYOU] = 0;

var ScoreReason = {
    DH: MJ.Result.DH,  // 点胡/点炮
    ZM: MJ.Result.ZM,  // 自摸/被自摸
    YJ: 11,            //游金
    LZ: ScoreRule.LZ, // 庄家
    QG: ScoreRule.QG, // 抢杠
};


var GangScore = {};
GangScore[MJ.Gang.BA] = 1;
GangScore[MJ.Gang.AN] = 2;
GangScore[MJ.Gang.DIAN] = 1;
GangScore[MJ.Gang.ANS] = 2;

exports.ScoreRule = ScoreRule;
exports.Pattern = Pattern;
exports.Result = Result;
exports.PatternScore = PatternScore;
exports.ItemScore = ItemScore;
exports.ScoreReason = ScoreReason;
exports.GangScore = GangScore;


//exports.SpecGang = SpecGang;
//exports.SpecGangScore = SpecGangScore;